package com.cn.xact.ty_treasured_book;

public class TYUserState {

    public static int TY_USER_INVALID_ID = -1;
    public static int TY_USER_VALID_ID = 1;

    private static int mUserId = TY_USER_INVALID_ID;
    private static String mUserNick;
    private static int mLoginCount;
    private static int mCredit;
    private static int mRank;
    private static String mIcon;
    private static int mGender;
    private static boolean mIsUserLoggedIn = false;

    public TYUserState(String userName) {
    //    mUserId = TY_USER_VALID_ID;
    //    mUserNick = new String(userName);
    }

    public static boolean isUserLoggedIn() {
        return mIsUserLoggedIn;
    }

    public static String getUserNick() {
        return mUserNick;
    }

    public static int getUserCredit() {
        return mCredit;
    }

    public static int getUserRank() {
        return mRank;
    }

    public static int getUserLoginCount() {
        return mLoginCount;
    }

    public static int getUserGender() {
        return mGender;
    }

    public static void userLogOut() {
        mIsUserLoggedIn = false;
    }

    public static void updateUserState(int loginCount, int credit, int rank, int gender, String icon, String nick) {
        mLoginCount = loginCount;
        mCredit = credit;
        mRank = rank;
        mGender = gender;
        mIcon = icon;
        mUserNick = nick;

        mIsUserLoggedIn = true;
    }
}
